<template>
  <div style="padding:15px;">
    <Tabs value="line">
      <TabPane label="线路成本核算" name="line">
        <DatePicker
          placeholder="选择时间范围"
          placement="bottom-start"
          style="width: 200px;margin:10px 0;"
          type="daterange"
        ></DatePicker>
        <div class="btnBox" style="margin-left:5px;">
          <Button icon="md-search" type="primary" @click="handleSearch">查询</Button>
          <Button icon="md-refresh" @click="handleReset">重置</Button>
        </div>
        <br/>
        <Button icon="md-cloud-download" style="margin-bottom:10px;">导出</Button>
        <br/>
        <template>
          <Table :columns="columns" :data="data1" :loading="loading" border stripe></Table>
        </template>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="1"
            :page-size="data1.length"
            :total="total"
            show-total
            @on-change="changePage"
            @on-page-size-change="changePageSize"
          />
        </Row>
      </TabPane>
      <TabPane label="单车成本核算" name="vehicle">
        <Select v-model="model1" placeholder="选择线路" style="width:200px;margin:10px 10px 10px 0;">
          <Option v-for="item in lines" :key="item.value" :value="item.value">{{ item.label }}</Option>
        </Select>
        <DatePicker
          placeholder="选择时间范围"
          placement="bottom-start"
          style="width: 200px;margin:0 10px 10px 0;"
          type="daterange"
        ></DatePicker>
        <div class="btnBox">
          <Button icon="md-search" type="primary" @click="handleSearch">查询</Button>
          <Button icon="md-refresh" @click="handleReset">重置</Button>
        </div>
        <br/>
        <Button icon="md-cloud-download" style="margin-bottom:10px;">导出</Button>
        <br/>
        <template style="font-size:10px">
          <Table :columns="column2" :data="data2" :loading="loading" border stripe></Table>
        </template>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="1"
            :page-size="data1.length"
            :total="total"
            show-total
            @on-change="changePage"
            @on-page-size-change="changePageSize"
          />
        </Row>
      </TabPane>
    </Tabs>
  </div>
</template>
<script>
export default {
  data() {
    return {
      total: 0,
      loading: false,
      columns: [
        {
          title: '线路',
          key: 'line',
          align: 'center'
        },
        {
          title: '工资',
          key: 'salary',
          align: 'center'
        },
        {
          title: '气耗',
          key: 'scfm',
          align: 'center'
        },
        {
          title: '逸华加气',
          key: 'yihua',
          align: 'center'
        },
        {
          title: '充电',
          key: 'charge',
          align: 'center'
        },
        {
          title: '修理费',
          key: 'repairs',
          align: 'center'
        },
        {
          title: '轮胎',
          key: 'tyre',
          align: 'center'
        },
        {
          title: '保险费',
          key: 'premium',
          align: 'center'
        },
        {
          title: '费用',
          key: 'cost',
          align: 'center'
        },
        {
          title: '折旧',
          key: 'depreciation',
          align: 'center'
        },
        {
          title: '洗车/例检',
          key: 'inspect',
          align: 'center'
        },
        {
          title: '五险',
          key: 'insurance',
          align: 'center'
        },
        {
          title: '其他',
          key: 'other',
          align: 'center'
        },
        {
          title: '合计',
          key: 'sum',
          align: 'center'
        },
        {
          title: '营业税金及附加',
          width: 140,
          key: 'taxes',
          align: 'center'
        }
      ],
      column2: [
        {
          title: '车号',
          key: 'license',
          align: 'center'
        },
        {
          title: '线路',
          key: 'line',
          align: 'center'
        },
        {
          title: '车公里',
          key: 'km',
          align: 'center'
        },
        {
          title: '趟次',
          key: 'trips',
          align: 'center'
        },
        {
          title: '含税实际主营收入',
          key: 'mainIncome',
          align: 'center'
        },
        {
          title: '入账主营收入',
          key: 'income',
          align: 'center'
        },
        {
          title: '成本项目',
          align: 'center',
          children: [
            {
              title: '工资',
              key: 'salary',
              align: 'center'
            },
            {
              title: '气耗',
              key: 'scfm',
              align: 'center'
            },
            {
              title: '逸华加气',
              key: 'yihua',
              align: 'center'
            },
            {
              title: '修理费',
              key: 'repairs',
              align: 'center'
            },
            {
              title: '轮胎',
              key: 'tyre',
              align: 'center'
            },
            {
              title: '保险费',
              key: 'premium',
              align: 'center'
            },
            {
              title: '费用',
              key: 'cost',
              align: 'center'
            },
            {
              title: '折旧',
              key: 'depreciation',
              align: 'center'
            },
            {
              title: '洗车/例检',
              key: 'inspect',
              align: 'center'
            },
            {
              title: '五险',
              key: 'insurance',
              align: 'center'
            },
            {
              title: '其他',
              key: 'other',
              align: 'center'
            },
            {
              title: '合计',
              key: 'sum',
              align: 'center'
            }
          ]
        },
        {
          title: '营业税金及附加',
          key: 'taxes',
          align: 'center'
        },
        {
          title: '实际主营利润 ',
          key: 'profit',
          align: 'center'
        },
        {
          title: '盈利亏损排列',
          key: 'ranking',
          align: 'center'
        }
      ],
      data1: [
        {
          line: '1路',
          salary: 8433.73,
          scfm: 0,
          yihua: 5605.19,
          charge: 0,
          repairs: 0,
          tyre: 731.96,
          premium: 2720.92,
          cost: 78.77,
          depreciation: 210.93,
          inspect: 2764.11,
          insurance: 4.72,
          other: 28376.67,
          sum: 48927.0,
          taxes: -9752.52
        },
        {
          line: '合计',
          salary: 8433.73,
          scfm: 0,
          yihua: 5605.19,
          charge: 0,
          repairs: 0,
          tyre: 731.96,
          premium: 2720.92,
          cost: 78.77,
          depreciation: 210.93,
          inspect: 2764.11,
          insurance: 4.72,
          other: 28376.67,
          sum: 48927.0,
          taxes: -9752.52
        }
      ],
      data2: [
        {
          license: '18019',
          line: '1路',
          km: '6344',
          trips: '245',
          mainIncome: '20738.00',
          income: '20133.98',
          salary: '7951.23',
          scfm: '9161.58',
          yihua: '0',
          repairs: '1496.19',
          tyre: '0',
          premium: '530.44',
          cost: '2720.92',
          depreciation: '78.77',
          inspect: '210.93',
          insurance: '2764.11',
          other: '4.72',
          sum: '24918.89',
          taxes: '72.94',
          profit: '-4857.85',
          ranking: 8
        },
        {
          license: '18019',
          line: '合计',
          km: '6344',
          trips: '245',
          mainIncome: '20738.00',
          income: '20133.98',
          salary: '7951.23',
          scfm: '9161.58',
          yihua: '0',
          repairs: '1496.19',
          tyre: '0',
          premium: '530.44',
          cost: '2720.92',
          depreciation: '78.77',
          inspect: '210.93',
          insurance: '2764.11',
          other: '4.72',
          sum: '24918.89',
          taxes: '72.94',
          profit: '-4857.85',
          ranking: ''
        }
      ],
      lines: [
        {
          value: 1,
          label: 1
        },
        {
          value: 2,
          label: 2
        },
        {
          value: 3,
          label: 3
        },
        {
          value: 4,
          label: 4
        },
        {
          value: 5,
          label: 5
        }
      ],
      model1: ''
    }
  },
  methods: {
    changePage() {
    },
    changePageSize() {
    },
    handleReset() {
    },
    handleSearch() {
    }
  }
}
</script>
